Beginning with Machine Learning: The Ultimate Introduction to Machine Learning, Deep Learning, Scikit-learn, and TensorFlow by Dr. Amit Dua & Umair Ayub

Beginning with Machine Learning: The Ultimate Introduction to Machine Learning, Deep Learning, Scikit-learn, and TensorFlow by Dr. Amit Dua & Umair Ayub

Author:Dr. Amit Dua & Umair Ayub [Dua, Dr. Amit & Ayub, Umair]
Language: eng
Format: epub, mobi, pdf
Publisher: BPB Publications
Published: 2023-01-15T00:00:00+00:00


C: This is regarded as the regularization parameter.

Gamma: This is the coefficient for sigmoid, poly kernel parameters.

Kernel: This parameter can be set to linear, sigmoid, poly.

Degree: A custom value of a degree can be passed for the poly kernel parameter.

Max_iter: This hyperparameter denotes the maximum number of iterations that can be done.

Before passing them to the GridSearchCV function, we need to predefine the values of these selected hyperparameters. We can use a Python dictionary by describing the various hyperparameters and the values associated with them. Consider the example as follows:

{ ‘C’: [0.2, 2, 20, 200, 2000], ‘gamma’: [2, 0.2, 0.02, 0.002, 0.0002], ‘kernel’: [‘linear’, ‘sigmoid’, ‘rbf’] }

We have predefined the values of only these three, meaning the remaining hyperparameters will be set to some default values. GridSearchCV attempts all of the combinations of the values handed withinside the dictionary and evaluates the version for every combination by using the Cross-Validation method.

Through this method, the accuracy associated with every combination of hyperparameters can be determined, and then a combination that generates the highest accuracy can be selected.

Now, let us take a look at how GridSearchCV achieves all this. Before doing that, we need to know that GridSearchCV itself has several arguments. Some of the important ones are as follows:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.